//
//

#import "UIScrollView+XBKit.h"


@implementation UIScrollView (XBKit)
//为表格添加自定义动画下拉刷新控件
- (void)addCustomGifHeaderRefreshAction:(SEL)action target:(id)target{
    
    MJChiBaoZiHeader *header =[MJChiBaoZiHeader headerWithRefreshingTarget:target refreshingAction:action];
    
    header.lastUpdatedTimeLabel.hidden= NO;//如果不隐藏这个会默认 图片在最左边不是在中间
    header.stateLabel.hidden = NO;
    self.mj_header = header;
}
- (void)addCustomNormalFooterRefreshAction:(SEL)action target:(id)target{
    // 设置header
    MJArrowFooter *footer = [MJArrowFooter footerWithRefreshingTarget:target refreshingAction:action];
    footer.automaticallyChangeAlpha = YES;
    [footer setTitle:@"已经到底了" forState:MJRefreshStateNoMoreData];
    self.mj_footer = footer;
}

- (void)hideDeleteConfirmation{
    
    UITableView *tableView =(UITableView *) self;
    
    SEL hideConfirmationViewSelector = NSSelectorFromString([NSString stringWithFormat:@"_endSwi%@teRowDi%@:", @"peToDele", @"dDelete"]);
    SEL getCellSelector = NSSelectorFromString([NSString stringWithFormat:@"_sw%@oDele%@ll", @"ipeT", @"teCe"]);
    
    if ([tableView respondsToSelector:hideConfirmationViewSelector] && [tableView respondsToSelector:getCellSelector]) {
        
        ((void(*)(id, SEL, BOOL))objc_msgSend)(tableView, hideConfirmationViewSelector, NO);
        
    }
}




@end
